#include <iostream>
#include "FB.h"
#include <boost/test/included/unit_test.hpp>

using namespace std;


BOOST_AUTO_TEST_CASE(extractMin_Test1)
{
	int min = 1;
	FibonacciHeap<int, int> heap;
	for (int i = 1; i < 1000; i++) {
		heap.insert(i, i);
	}
	BOOST_CHECK_EQUAL(heap.extractMin()->key, min);
}

BOOST_AUTO_TEST_CASE(extractMin_Test2)
{
	int min = 1;
	FibonacciHeap<int, int> heap;
	for (int i = 1000; i > 0; i--) {
		heap.insert(i, i);
	}
	BOOST_CHECK_EQUAL(heap.extractMin()->key, min);
}

BOOST_AUTO_TEST_CASE(decreaseKey_Test1)
{
	FibonacciHeap<int, int> heap;
	for (int i = 1000; i > 0; i--) {
		heap.insert(i, i);
	}
	heap.decreaseKey(heap.extractMin(), 0);
	BOOST_CHECK_EQUAL(heap.extractMin()->key, 0);
}